<template>
  <PageWrapper dense>
    <CollapseContainer title="摘要">
      <Description :column="1" :bordered="false" :data="customerInfo" :schema="schema" />
    </CollapseContainer>
  </PageWrapper>
</template>

<script setup lang="ts">
  import { toRefs } from 'vue';
  import { CollapseContainer } from '@/components/Container';
  import { PageWrapper } from '@/components/Page';
  import { Description, DescItem } from '@/components/Description/index';
  defineOptions({ name: 'Abstract' });
  const props = defineProps({
    customerInfo: {
      type: Object,
      default: () => ({}),
    },
  });
  const { customerInfo } = toRefs(props);
  const schema: DescItem[] = [
    {
      field: 'test1',
      label: '订单金额',
      render: (curVal = 0) => {
        return `${curVal}`;
      },
    },
    {
      field: 'test2',
      label: '实收金额',
      render: (curVal = 0) => {
        return `${curVal}`;
      },
    },
    {
      field: 'test3',
      label: '毛利润',
      render: (curVal = 0) => {
        return `${curVal}`;
      },
    },
    {
      field: 'test4',
      label: '利润率',
      render: (curVal = 0) => {
        return `${curVal}%`;
      },
    },
  ];
</script>
